{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import xgboost as xgb\n",
    "import sys,random\n",
    "import pickle\n",
    "import os"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "if not os.path.exists('featurescore'):\n",
    "    os.mkdir('featurescore')\n",
    "if not os.path.exists('model'):\n",
    "    os.mkdir('model')\n",
    "if not os.path.exists('preds'):\n",
    "    os.mkdir('preds')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "CPU times: user 35 s, sys: 1min 23s, total: 1min 58s\n",
      "Wall time: 2min\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "#use rank_d  and rank_nd feature\n",
    "#load data\n",
    "train_x_d = pd.read_csv('../../preprocess_data/train_x_float_rank_d.csv')\n",
    "train_x_nd = pd.read_csv('../../preprocess_data/train_x_float_rank_nd.csv')\n",
    "train_x = pd.merge(train_x_d,train_x_nd,on='id')\n",
    "train_y = pd.read_csv('../../preprocess_data/train_y_33465.csv')\n",
    "train_x = train_x.drop(['id'],axis=1)\n",
    "dtrain = xgb.DMatrix(train_x, label=train_y)\n",
    "\n",
    "valid_d = pd.read_csv('../../preprocess_data/valid_float_rank_d.csv')\n",
    "valid_nd = pd.read_csv('../../preprocess_data/valid_float_rank_nd.csv')\n",
    "valid = pd.merge(valid_d,valid_nd,on='id')\n",
    "valid_id = valid.id\n",
    "valid = valid.drop(\"id\",axis=1)\n",
    "dvalid = xgb.DMatrix(valid)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "def pipeline(dtrain,dtest,test_id,iteration,random_seed,gamma,max_depth,lambd,subsample,colsample_bytree,min_child_weight):\n",
    "    if max_depth==6:\n",
    "        num_boost_round = 3000\n",
    "    elif max_depth==7:\n",
    "        num_boost_round = 2500\n",
    "    elif max_depth==8:\n",
    "        num_boost_round = 2000\n",
    "    \n",
    "    params={\n",
    "    'booster':'gbtree',\n",
    "    'objective': 'binary:logistic',\n",
    "#     'scale_pos_weight': float(len(y)-sum(y))/float(sum(y)),\n",
    "    'eval_metric': 'auc',\n",
    "    'gamma':gamma,\n",
    "    'max_depth':max_depth,\n",
    "    'lambda':lambd,\n",
    "    'subsample':subsample,\n",
    "    'colsample_bytree':colsample_bytree,\n",
    "    'min_child_weight':min_child_weight, \n",
    "    'eta': 0.04,\n",
    "    'seed':random_seed,\n",
    "    'nthread':16\n",
    "        }\n",
    "    watchlist  = [(dtrain,'train')]\n",
    "    model = xgb.train(params,dtrain,num_boost_round=num_boost_round,evals=watchlist)\n",
    "    model.save_model('./model/xgb{0}.model'.format(iteration))\n",
    "    \n",
    "    #predict test set\n",
    "    test_y = model.predict(dtest)\n",
    "    test_result = pd.DataFrame(test_id,columns=[\"id\"])\n",
    "    test_result['score'] = test_y\n",
    "    test_result.to_csv(\"./preds/xgb{0}.csv\".format(iteration),index=None,encoding='utf-8')\n",
    "    \n",
    "    #get feature score\n",
    "    feature_score = model.get_fscore()\n",
    "    feature_score = sorted(feature_score.items(), key=lambda x:x[1],reverse=True)\n",
    "    fs = []\n",
    "    for (key,value) in feature_score:\n",
    "        fs.append(\"{0},{1}\\n\".format(key,value))\n",
    "    \n",
    "    with open('./featurescore/feature_score_{0}.csv'.format(iteration),'w') as f:\n",
    "        f.writelines(\"feature,score\\n\")\n",
    "        f.writelines(fs)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0]\ttrain-auc:0.50083\n",
      "[1]\ttrain-auc:0.5016\n",
      "[2]\ttrain-auc:0.502593\n",
      "[3]\ttrain-auc:0.502594\n",
      "[4]\ttrain-auc:0.502694\n",
      "[5]\ttrain-auc:0.502694\n",
      "[6]\ttrain-auc:0.502694\n",
      "[7]\ttrain-auc:0.502694\n",
      "[8]\ttrain-auc:0.502989\n",
      "[9]\ttrain-auc:0.503438\n",
      "[10]\ttrain-auc:0.503554\n",
      "[11]\ttrain-auc:0.505637\n",
      "[12]\ttrain-auc:0.506291\n",
      "[13]\ttrain-auc:0.506523\n",
      "[14]\ttrain-auc:0.506414\n",
      "[15]\ttrain-auc:0.506927\n",
      "[16]\ttrain-auc:0.507174\n",
      "[17]\ttrain-auc:0.507174\n",
      "[18]\ttrain-auc:0.507468\n",
      "[19]\ttrain-auc:0.507473\n",
      "[20]\ttrain-auc:0.509148\n",
      "[21]\ttrain-auc:0.511196\n",
      "[22]\ttrain-auc:0.511692\n",
      "[23]\ttrain-auc:0.511695\n",
      "[24]\ttrain-auc:0.512015\n",
      "[25]\ttrain-auc:0.512\n",
      "[26]\ttrain-auc:0.560574\n",
      "[27]\ttrain-auc:0.561206\n",
      "[28]\ttrain-auc:0.561583\n",
      "[29]\ttrain-auc:0.631795\n",
      "[30]\ttrain-auc:0.631964\n",
      "[31]\ttrain-auc:0.63254\n",
      "[32]\ttrain-auc:0.632704\n",
      "[33]\ttrain-auc:0.67143\n",
      "[34]\ttrain-auc:0.671533\n",
      "[35]\ttrain-auc:0.670726\n",
      "[36]\ttrain-auc:0.687185\n",
      "[37]\ttrain-auc:0.691081\n",
      "[38]\ttrain-auc:0.693926\n",
      "[39]\ttrain-auc:0.700047\n",
      "[40]\ttrain-auc:0.709362\n",
      "[41]\ttrain-auc:0.711017\n",
      "[42]\ttrain-auc:0.713392\n",
      "[43]\ttrain-auc:0.715907\n",
      "[44]\ttrain-auc:0.722825\n",
      "[45]\ttrain-auc:0.723819\n",
      "[46]\ttrain-auc:0.725235\n",
      "[47]\ttrain-auc:0.726518\n",
      "[48]\ttrain-auc:0.727779\n",
      "[49]\ttrain-auc:0.728223\n",
      "[50]\ttrain-auc:0.729948\n",
      "[51]\ttrain-auc:0.730497\n",
      "[52]\ttrain-auc:0.737269\n",
      "[53]\ttrain-auc:0.742322\n",
      "[54]\ttrain-auc:0.746128\n",
      "[55]\ttrain-auc:0.748417\n",
      "[56]\ttrain-auc:0.750755\n",
      "[57]\ttrain-auc:0.752453\n",
      "[58]\ttrain-auc:0.753254\n",
      "[59]\ttrain-auc:0.754687\n",
      "[60]\ttrain-auc:0.754868\n",
      "[61]\ttrain-auc:0.755677\n",
      "[62]\ttrain-auc:0.755919\n",
      "[63]\ttrain-auc:0.756841\n",
      "[64]\ttrain-auc:0.758348\n",
      "[65]\ttrain-auc:0.758513\n",
      "[66]\ttrain-auc:0.758723\n",
      "[67]\ttrain-auc:0.76074\n",
      "[68]\ttrain-auc:0.761532\n",
      "[69]\ttrain-auc:0.763399\n",
      "[70]\ttrain-auc:0.763846\n",
      "[71]\ttrain-auc:0.765735\n",
      "[72]\ttrain-auc:0.766459\n",
      "[73]\ttrain-auc:0.767393\n",
      "[74]\ttrain-auc:0.7688\n",
      "[75]\ttrain-auc:0.768863\n",
      "[76]\ttrain-auc:0.769923\n",
      "[77]\ttrain-auc:0.771379\n",
      "[78]\ttrain-auc:0.772605\n",
      "[79]\ttrain-auc:0.772657\n",
      "[80]\ttrain-auc:0.773148\n",
      "[81]\ttrain-auc:0.774539\n",
      "[82]\ttrain-auc:0.775482\n",
      "[83]\ttrain-auc:0.776739\n",
      "[84]\ttrain-auc:0.778216\n",
      "[85]\ttrain-auc:0.779781\n",
      "[86]\ttrain-auc:0.780545\n",
      "[87]\ttrain-auc:0.78157\n",
      "[88]\ttrain-auc:0.782122\n",
      "[89]\ttrain-auc:0.782626\n",
      "[90]\ttrain-auc:0.783011\n",
      "[91]\ttrain-auc:0.783718\n",
      "[92]\ttrain-auc:0.784671\n",
      "[93]\ttrain-auc:0.785007\n",
      "[94]\ttrain-auc:0.785864\n",
      "[95]\ttrain-auc:0.786689\n",
      "[96]\ttrain-auc:0.787118\n",
      "[97]\ttrain-auc:0.78781\n",
      "[98]\ttrain-auc:0.788543\n",
      "[99]\ttrain-auc:0.788823\n",
      "[100]\ttrain-auc:0.789286\n",
      "[101]\ttrain-auc:0.789709\n",
      "[102]\ttrain-auc:0.790504\n",
      "[103]\ttrain-auc:0.791294\n",
      "[104]\ttrain-auc:0.792169\n",
      "[105]\ttrain-auc:0.792956\n",
      "[106]\ttrain-auc:0.793358\n",
      "[107]\ttrain-auc:0.79395\n",
      "[108]\ttrain-auc:0.794461\n",
      "[109]\ttrain-auc:0.795145\n",
      "[110]\ttrain-auc:0.795483\n",
      "[111]\ttrain-auc:0.79613\n",
      "[112]\ttrain-auc:0.796759\n",
      "[113]\ttrain-auc:0.797547\n",
      "[114]\ttrain-auc:0.798125\n",
      "[115]\ttrain-auc:0.798801\n",
      "[116]\ttrain-auc:0.799442\n",
      "[117]\ttrain-auc:0.799813\n",
      "[118]\ttrain-auc:0.800335\n",
      "[119]\ttrain-auc:0.800918\n",
      "[120]\ttrain-auc:0.80125\n",
      "[121]\ttrain-auc:0.802016\n",
      "[122]\ttrain-auc:0.802652\n",
      "[123]\ttrain-auc:0.803139\n",
      "[124]\ttrain-auc:0.803635\n",
      "[125]\ttrain-auc:0.803988\n",
      "[126]\ttrain-auc:0.804294\n",
      "[127]\ttrain-auc:0.804828\n",
      "[128]\ttrain-auc:0.805408\n",
      "[129]\ttrain-auc:0.805792\n",
      "[130]\ttrain-auc:0.806295\n",
      "[131]\ttrain-auc:0.806903\n",
      "[132]\ttrain-auc:0.807342\n",
      "[133]\ttrain-auc:0.807985\n",
      "[134]\ttrain-auc:0.808342\n",
      "[135]\ttrain-auc:0.80879\n",
      "[136]\ttrain-auc:0.80934\n",
      "[137]\ttrain-auc:0.809813\n",
      "[138]\ttrain-auc:0.810326\n",
      "[139]\ttrain-auc:0.810732\n",
      "[140]\ttrain-auc:0.811032\n",
      "[141]\ttrain-auc:0.811411\n",
      "[142]\ttrain-auc:0.811821\n",
      "[143]\ttrain-auc:0.812076\n",
      "[144]\ttrain-auc:0.812585\n",
      "[145]\ttrain-auc:0.812872\n",
      "[146]\ttrain-auc:0.813517\n",
      "[147]\ttrain-auc:0.813994\n",
      "[148]\ttrain-auc:0.814392\n",
      "[149]\ttrain-auc:0.814904\n",
      "[150]\ttrain-auc:0.81532\n",
      "[151]\ttrain-auc:0.815476\n",
      "[152]\ttrain-auc:0.815901\n",
      "[153]\ttrain-auc:0.816155\n",
      "[154]\ttrain-auc:0.816318\n",
      "[155]\ttrain-auc:0.816749\n",
      "[156]\ttrain-auc:0.817094\n",
      "[157]\ttrain-auc:0.817528\n",
      "[158]\ttrain-auc:0.817872\n",
      "[159]\ttrain-auc:0.818237\n",
      "[160]\ttrain-auc:0.818652\n",
      "[161]\ttrain-auc:0.818948\n",
      "[162]\ttrain-auc:0.819325\n",
      "[163]\ttrain-auc:0.819686\n",
      "[164]\ttrain-auc:0.819935\n",
      "[165]\ttrain-auc:0.820269\n",
      "[166]\ttrain-auc:0.82058\n",
      "[167]\ttrain-auc:0.820947\n",
      "[168]\ttrain-auc:0.821237\n",
      "[169]\ttrain-auc:0.821587\n",
      "[170]\ttrain-auc:0.821883\n",
      "[171]\ttrain-auc:0.822241\n",
      "[172]\ttrain-auc:0.822477\n",
      "[173]\ttrain-auc:0.822722\n",
      "[174]\ttrain-auc:0.82302\n",
      "[175]\ttrain-auc:0.823336\n",
      "[176]\ttrain-auc:0.823649\n",
      "[177]\ttrain-auc:0.824029\n",
      "[178]\ttrain-auc:0.8244\n",
      "[179]\ttrain-auc:0.824728\n",
      "[180]\ttrain-auc:0.82519\n",
      "[181]\ttrain-auc:0.825576\n",
      "[182]\ttrain-auc:0.825955\n",
      "[183]\ttrain-auc:0.826301\n",
      "[184]\ttrain-auc:0.826568\n",
      "[185]\ttrain-auc:0.826934\n",
      "[186]\ttrain-auc:0.827162\n",
      "[187]\ttrain-auc:0.827408\n",
      "[188]\ttrain-auc:0.827731\n",
      "[189]\ttrain-auc:0.828183\n",
      "[190]\ttrain-auc:0.828535\n",
      "[191]\ttrain-auc:0.828821\n",
      "[192]\ttrain-auc:0.8291\n",
      "[193]\ttrain-auc:0.829536\n",
      "[194]\ttrain-auc:0.82976\n",
      "[195]\ttrain-auc:0.830074\n",
      "[196]\ttrain-auc:0.830545\n",
      "[197]\ttrain-auc:0.830898\n",
      "[198]\ttrain-auc:0.831279\n",
      "[199]\ttrain-auc:0.83157\n",
      "[200]\ttrain-auc:0.831826\n",
      "[201]\ttrain-auc:0.832176\n",
      "[202]\ttrain-auc:0.832474\n",
      "[203]\ttrain-auc:0.832685\n",
      "[204]\ttrain-auc:0.832982\n",
      "[205]\ttrain-auc:0.833133\n",
      "[206]\ttrain-auc:0.833503\n",
      "[207]\ttrain-auc:0.833745\n",
      "[208]\ttrain-auc:0.834071\n",
      "[209]\ttrain-auc:0.834358\n",
      "[210]\ttrain-auc:0.834605\n",
      "[211]\ttrain-auc:0.835001\n",
      "[212]\ttrain-auc:0.835349\n",
      "[213]\ttrain-auc:0.835669\n",
      "[214]\ttrain-auc:0.835952\n",
      "[215]\ttrain-auc:0.836132\n",
      "[216]\ttrain-auc:0.836448\n",
      "[217]\ttrain-auc:0.836698\n",
      "[218]\ttrain-auc:0.836915\n",
      "[219]\ttrain-auc:0.837209\n",
      "[220]\ttrain-auc:0.837486\n",
      "[221]\ttrain-auc:0.837837\n",
      "[222]\ttrain-auc:0.838105\n",
      "[223]\ttrain-auc:0.838407\n",
      "[224]\ttrain-auc:0.838743\n",
      "[225]\ttrain-auc:0.839042\n",
      "[226]\ttrain-auc:0.839312\n",
      "[227]\ttrain-auc:0.839475\n",
      "[228]\ttrain-auc:0.839636\n",
      "[229]\ttrain-auc:0.839885\n",
      "[230]\ttrain-auc:0.84022\n",
      "[231]\ttrain-auc:0.840377\n",
      "[232]\ttrain-auc:0.84065\n",
      "[233]\ttrain-auc:0.840968\n",
      "[234]\ttrain-auc:0.841244\n",
      "[235]\ttrain-auc:0.841438\n",
      "[236]\ttrain-auc:0.841742\n",
      "[237]\ttrain-auc:0.841976\n",
      "[238]\ttrain-auc:0.842171\n",
      "[239]\ttrain-auc:0.842498\n",
      "[240]\ttrain-auc:0.842731\n",
      "[241]\ttrain-auc:0.843001\n",
      "[242]\ttrain-auc:0.843389\n",
      "[243]\ttrain-auc:0.843567\n",
      "[244]\ttrain-auc:0.843904\n",
      "[245]\ttrain-auc:0.844069\n",
      "[246]\ttrain-auc:0.844339\n",
      "[247]\ttrain-auc:0.844717\n",
      "[248]\ttrain-auc:0.845021\n",
      "[249]\ttrain-auc:0.845354\n",
      "[250]\ttrain-auc:0.845593\n",
      "[251]\ttrain-auc:0.845812\n",
      "[252]\ttrain-auc:0.845996\n",
      "[253]\ttrain-auc:0.846283\n",
      "[254]\ttrain-auc:0.84652\n",
      "[255]\ttrain-auc:0.846803\n",
      "[256]\ttrain-auc:0.847102\n",
      "[257]\ttrain-auc:0.84735\n",
      "[258]\ttrain-auc:0.847734\n",
      "[259]\ttrain-auc:0.847896\n",
      "[260]\ttrain-auc:0.848206\n",
      "[261]\ttrain-auc:0.848452\n",
      "[262]\ttrain-auc:0.84868\n",
      "[263]\ttrain-auc:0.848981\n",
      "[264]\ttrain-auc:0.849182\n",
      "[265]\ttrain-auc:0.849488\n",
      "[266]\ttrain-auc:0.849696\n",
      "[267]\ttrain-auc:0.84979\n",
      "[268]\ttrain-auc:0.850124\n",
      "[269]\ttrain-auc:0.850438\n",
      "[270]\ttrain-auc:0.850704\n",
      "[271]\ttrain-auc:0.851139\n",
      "[272]\ttrain-auc:0.851382\n",
      "[273]\ttrain-auc:0.851627\n",
      "[274]\ttrain-auc:0.85191\n",
      "[275]\ttrain-auc:0.852106\n",
      "[276]\ttrain-auc:0.85226\n",
      "[277]\ttrain-auc:0.85244\n",
      "[278]\ttrain-auc:0.852686\n",
      "[279]\ttrain-auc:0.852972\n",
      "[280]\ttrain-auc:0.853201\n",
      "[281]\ttrain-auc:0.853478\n",
      "[282]\ttrain-auc:0.853768\n",
      "[283]\ttrain-auc:0.854016\n",
      "[284]\ttrain-auc:0.854267\n",
      "[285]\ttrain-auc:0.854463\n",
      "[286]\ttrain-auc:0.854756\n",
      "[287]\ttrain-auc:0.855012\n",
      "[288]\ttrain-auc:0.855212\n",
      "[289]\ttrain-auc:0.855496\n",
      "[290]\ttrain-auc:0.855683\n",
      "[291]\ttrain-auc:0.855948\n",
      "[292]\ttrain-auc:0.856239\n",
      "[293]\ttrain-auc:0.856489\n",
      "[294]\ttrain-auc:0.856744\n",
      "[295]\ttrain-auc:0.856901\n",
      "[296]\ttrain-auc:0.857182\n",
      "[297]\ttrain-auc:0.857371\n",
      "[298]\ttrain-auc:0.857522\n",
      "[299]\ttrain-auc:0.857791\n",
      "[300]\ttrain-auc:0.858031\n",
      "[301]\ttrain-auc:0.858252\n",
      "[302]\ttrain-auc:0.85841\n",
      "[303]\ttrain-auc:0.858675\n",
      "[304]\ttrain-auc:0.858806\n",
      "[305]\ttrain-auc:0.859012\n",
      "[306]\ttrain-auc:0.859246\n",
      "[307]\ttrain-auc:0.859513\n",
      "[308]\ttrain-auc:0.85974\n",
      "[309]\ttrain-auc:0.859967\n",
      "[310]\ttrain-auc:0.860226\n",
      "[311]\ttrain-auc:0.860395\n",
      "[312]\ttrain-auc:0.860658\n",
      "[313]\ttrain-auc:0.860876\n",
      "[314]\ttrain-auc:0.861115\n",
      "[315]\ttrain-auc:0.861349\n",
      "[316]\ttrain-auc:0.861551\n",
      "[317]\ttrain-auc:0.861758\n",
      "[318]\ttrain-auc:0.861937\n",
      "[319]\ttrain-auc:0.862101\n",
      "[320]\ttrain-auc:0.862301\n",
      "[321]\ttrain-auc:0.862434\n",
      "[322]\ttrain-auc:0.862658\n",
      "[323]\ttrain-auc:0.862858\n",
      "[324]\ttrain-auc:0.863061\n",
      "[325]\ttrain-auc:0.863234\n",
      "[326]\ttrain-auc:0.863462\n",
      "[327]\ttrain-auc:0.863616\n",
      "[328]\ttrain-auc:0.863833\n",
      "[329]\ttrain-auc:0.864073\n",
      "[330]\ttrain-auc:0.86435\n",
      "[331]\ttrain-auc:0.864555\n",
      "[332]\ttrain-auc:0.864794\n",
      "[333]\ttrain-auc:0.865025\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[334]\ttrain-auc:0.865277\n",
      "[335]\ttrain-auc:0.865517\n",
      "[336]\ttrain-auc:0.865771\n",
      "[337]\ttrain-auc:0.866015\n",
      "[338]\ttrain-auc:0.866212\n",
      "[339]\ttrain-auc:0.866405\n",
      "[340]\ttrain-auc:0.866625\n",
      "[341]\ttrain-auc:0.866845\n",
      "[342]\ttrain-auc:0.867095\n",
      "[343]\ttrain-auc:0.867284\n",
      "[344]\ttrain-auc:0.8676\n",
      "[345]\ttrain-auc:0.867779\n",
      "[346]\ttrain-auc:0.868015\n",
      "[347]\ttrain-auc:0.868252\n",
      "[348]\ttrain-auc:0.868473\n",
      "[349]\ttrain-auc:0.868646\n",
      "[350]\ttrain-auc:0.868813\n",
      "[351]\ttrain-auc:0.868983\n",
      "[352]\ttrain-auc:0.869195\n",
      "[353]\ttrain-auc:0.869434\n",
      "[354]\ttrain-auc:0.869673\n",
      "[355]\ttrain-auc:0.869865\n",
      "[356]\ttrain-auc:0.869969\n",
      "[357]\ttrain-auc:0.870178\n",
      "[358]\ttrain-auc:0.870379\n",
      "[359]\ttrain-auc:0.870509\n",
      "[360]\ttrain-auc:0.870726\n",
      "[361]\ttrain-auc:0.870959\n",
      "[362]\ttrain-auc:0.871159\n",
      "[363]\ttrain-auc:0.871325\n",
      "[364]\ttrain-auc:0.871554\n",
      "[365]\ttrain-auc:0.871734\n",
      "[366]\ttrain-auc:0.871971\n",
      "[367]\ttrain-auc:0.872182\n",
      "[368]\ttrain-auc:0.872375\n",
      "[369]\ttrain-auc:0.872631\n",
      "[370]\ttrain-auc:0.872872\n",
      "[371]\ttrain-auc:0.873125\n",
      "[372]\ttrain-auc:0.87336\n",
      "[373]\ttrain-auc:0.873546\n",
      "[374]\ttrain-auc:0.873773\n",
      "[375]\ttrain-auc:0.873971\n",
      "[376]\ttrain-auc:0.874169\n",
      "[377]\ttrain-auc:0.874333\n",
      "[378]\ttrain-auc:0.874516\n",
      "[379]\ttrain-auc:0.874719\n",
      "[380]\ttrain-auc:0.874901\n",
      "[381]\ttrain-auc:0.875123\n",
      "[382]\ttrain-auc:0.87531\n",
      "[383]\ttrain-auc:0.875515\n",
      "[384]\ttrain-auc:0.875733\n",
      "[385]\ttrain-auc:0.875905\n",
      "[386]\ttrain-auc:0.876142\n",
      "[387]\ttrain-auc:0.876369\n",
      "[388]\ttrain-auc:0.876573\n",
      "[389]\ttrain-auc:0.876743\n",
      "[390]\ttrain-auc:0.876945\n",
      "[391]\ttrain-auc:0.877191\n",
      "[392]\ttrain-auc:0.877446\n",
      "[393]\ttrain-auc:0.8776\n",
      "[394]\ttrain-auc:0.877831\n",
      "[395]\ttrain-auc:0.878003\n",
      "[396]\ttrain-auc:0.87817\n",
      "[397]\ttrain-auc:0.87835\n",
      "[398]\ttrain-auc:0.878571\n",
      "[399]\ttrain-auc:0.878768\n",
      "[400]\ttrain-auc:0.878946\n",
      "[401]\ttrain-auc:0.879179\n",
      "[402]\ttrain-auc:0.879358\n",
      "[403]\ttrain-auc:0.87961\n",
      "[404]\ttrain-auc:0.87983\n",
      "[405]\ttrain-auc:0.879933\n",
      "[406]\ttrain-auc:0.880138\n",
      "[407]\ttrain-auc:0.880326\n",
      "[408]\ttrain-auc:0.880426\n",
      "[409]\ttrain-auc:0.880622\n",
      "[410]\ttrain-auc:0.880832\n",
      "[411]\ttrain-auc:0.881027\n",
      "[412]\ttrain-auc:0.881203\n",
      "[413]\ttrain-auc:0.881315\n",
      "[414]\ttrain-auc:0.881499\n",
      "[415]\ttrain-auc:0.881696\n",
      "[416]\ttrain-auc:0.881843\n",
      "[417]\ttrain-auc:0.882002\n",
      "[418]\ttrain-auc:0.88217\n",
      "[419]\ttrain-auc:0.882353\n",
      "[420]\ttrain-auc:0.882591\n",
      "[421]\ttrain-auc:0.882743\n",
      "[422]\ttrain-auc:0.88293\n",
      "[423]\ttrain-auc:0.883149\n",
      "[424]\ttrain-auc:0.883334\n",
      "[425]\ttrain-auc:0.883496\n",
      "[426]\ttrain-auc:0.883688\n",
      "[427]\ttrain-auc:0.883953\n",
      "[428]\ttrain-auc:0.884084\n",
      "[429]\ttrain-auc:0.884284\n",
      "[430]\ttrain-auc:0.884519\n",
      "[431]\ttrain-auc:0.884705\n",
      "[432]\ttrain-auc:0.884859\n",
      "[433]\ttrain-auc:0.885027\n",
      "[434]\ttrain-auc:0.885185\n",
      "[435]\ttrain-auc:0.885342\n",
      "[436]\ttrain-auc:0.885583\n",
      "[437]\ttrain-auc:0.885766\n",
      "[438]\ttrain-auc:0.88596\n",
      "[439]\ttrain-auc:0.886167\n",
      "[440]\ttrain-auc:0.886346\n",
      "[441]\ttrain-auc:0.886541\n",
      "[442]\ttrain-auc:0.886712\n",
      "[443]\ttrain-auc:0.886911\n",
      "[444]\ttrain-auc:0.887058\n",
      "[445]\ttrain-auc:0.887276\n",
      "[446]\ttrain-auc:0.887413\n",
      "[447]\ttrain-auc:0.887627\n",
      "[448]\ttrain-auc:0.88785\n",
      "[449]\ttrain-auc:0.888019\n",
      "[450]\ttrain-auc:0.888188\n",
      "[451]\ttrain-auc:0.888376\n",
      "[452]\ttrain-auc:0.888539\n",
      "[453]\ttrain-auc:0.888713\n",
      "[454]\ttrain-auc:0.888795\n",
      "[455]\ttrain-auc:0.888926\n",
      "[456]\ttrain-auc:0.889109\n",
      "[457]\ttrain-auc:0.889272\n",
      "[458]\ttrain-auc:0.889439\n",
      "[459]\ttrain-auc:0.889596\n",
      "[460]\ttrain-auc:0.889744\n",
      "[461]\ttrain-auc:0.889924\n",
      "[462]\ttrain-auc:0.89006\n",
      "[463]\ttrain-auc:0.89019\n",
      "[464]\ttrain-auc:0.890373\n",
      "[465]\ttrain-auc:0.890523\n",
      "[466]\ttrain-auc:0.890627\n",
      "[467]\ttrain-auc:0.890792\n",
      "[468]\ttrain-auc:0.891008\n",
      "[469]\ttrain-auc:0.891146\n",
      "[470]\ttrain-auc:0.891364\n",
      "[471]\ttrain-auc:0.891514\n",
      "[472]\ttrain-auc:0.891688\n",
      "[473]\ttrain-auc:0.891865\n",
      "[474]\ttrain-auc:0.892034\n",
      "[475]\ttrain-auc:0.892188\n",
      "[476]\ttrain-auc:0.892388\n",
      "[477]\ttrain-auc:0.892552\n",
      "[478]\ttrain-auc:0.892723\n",
      "[479]\ttrain-auc:0.892846\n",
      "[480]\ttrain-auc:0.892983\n",
      "[481]\ttrain-auc:0.893144\n",
      "[482]\ttrain-auc:0.893292\n",
      "[483]\ttrain-auc:0.893456\n",
      "[484]\ttrain-auc:0.893566\n",
      "[485]\ttrain-auc:0.893758\n",
      "[486]\ttrain-auc:0.893912\n",
      "[487]\ttrain-auc:0.89407\n",
      "[488]\ttrain-auc:0.894218\n",
      "[489]\ttrain-auc:0.89436\n",
      "[490]\ttrain-auc:0.894528\n",
      "[491]\ttrain-auc:0.89473\n",
      "[492]\ttrain-auc:0.894839\n",
      "[493]\ttrain-auc:0.895\n",
      "[494]\ttrain-auc:0.895167\n",
      "[495]\ttrain-auc:0.895369\n",
      "[496]\ttrain-auc:0.895508\n",
      "[497]\ttrain-auc:0.895663\n",
      "[498]\ttrain-auc:0.895833\n",
      "[499]\ttrain-auc:0.895967\n",
      "[500]\ttrain-auc:0.896212\n",
      "[501]\ttrain-auc:0.89637\n",
      "[502]\ttrain-auc:0.896471\n",
      "[503]\ttrain-auc:0.896671\n",
      "[504]\ttrain-auc:0.896824\n",
      "[505]\ttrain-auc:0.897026\n",
      "[506]\ttrain-auc:0.897167\n",
      "[507]\ttrain-auc:0.897348\n",
      "[508]\ttrain-auc:0.897504\n",
      "[509]\ttrain-auc:0.89772\n",
      "[510]\ttrain-auc:0.897918\n",
      "[511]\ttrain-auc:0.898084\n",
      "[512]\ttrain-auc:0.898235\n",
      "[513]\ttrain-auc:0.8984\n",
      "[514]\ttrain-auc:0.898603\n",
      "[515]\ttrain-auc:0.898745\n",
      "[516]\ttrain-auc:0.898973\n",
      "[517]\ttrain-auc:0.899176\n",
      "[518]\ttrain-auc:0.89934\n",
      "[519]\ttrain-auc:0.899503\n",
      "[520]\ttrain-auc:0.899658\n",
      "[521]\ttrain-auc:0.899797\n",
      "[522]\ttrain-auc:0.899977\n",
      "[523]\ttrain-auc:0.900156\n",
      "[524]\ttrain-auc:0.900365\n",
      "[525]\ttrain-auc:0.90057\n",
      "[526]\ttrain-auc:0.900688\n",
      "[527]\ttrain-auc:0.900802\n",
      "[528]\ttrain-auc:0.900924\n",
      "[529]\ttrain-auc:0.901113\n",
      "[530]\ttrain-auc:0.901304\n",
      "[531]\ttrain-auc:0.901532\n",
      "[532]\ttrain-auc:0.901742\n",
      "[533]\ttrain-auc:0.901955\n",
      "[534]\ttrain-auc:0.902081\n",
      "[535]\ttrain-auc:0.902245\n",
      "[536]\ttrain-auc:0.902433\n",
      "[537]\ttrain-auc:0.902589\n",
      "[538]\ttrain-auc:0.902706\n",
      "[539]\ttrain-auc:0.902872\n",
      "[540]\ttrain-auc:0.903039\n",
      "[541]\ttrain-auc:0.903216\n",
      "[542]\ttrain-auc:0.903414\n",
      "[543]\ttrain-auc:0.903533\n",
      "[544]\ttrain-auc:0.903699\n",
      "[545]\ttrain-auc:0.903815\n",
      "[546]\ttrain-auc:0.903962\n",
      "[547]\ttrain-auc:0.904132\n",
      "[548]\ttrain-auc:0.904204\n",
      "[549]\ttrain-auc:0.904407\n",
      "[550]\ttrain-auc:0.904553\n",
      "[551]\ttrain-auc:0.904721\n",
      "[552]\ttrain-auc:0.904885\n",
      "[553]\ttrain-auc:0.905045\n",
      "[554]\ttrain-auc:0.905178\n",
      "[555]\ttrain-auc:0.905364\n",
      "[556]\ttrain-auc:0.905513\n",
      "[557]\ttrain-auc:0.905738\n",
      "[558]\ttrain-auc:0.905903\n",
      "[559]\ttrain-auc:0.90602\n",
      "[560]\ttrain-auc:0.906162\n",
      "[561]\ttrain-auc:0.906271\n",
      "[562]\ttrain-auc:0.906417\n",
      "[563]\ttrain-auc:0.90657\n",
      "[564]\ttrain-auc:0.906709\n",
      "[565]\ttrain-auc:0.906802\n",
      "[566]\ttrain-auc:0.906949\n",
      "[567]\ttrain-auc:0.907101\n",
      "[568]\ttrain-auc:0.907245\n",
      "[569]\ttrain-auc:0.907397\n",
      "[570]\ttrain-auc:0.907508\n",
      "[571]\ttrain-auc:0.907611\n",
      "[572]\ttrain-auc:0.907708\n",
      "[573]\ttrain-auc:0.907808\n",
      "[574]\ttrain-auc:0.90793\n",
      "[575]\ttrain-auc:0.908191\n",
      "[576]\ttrain-auc:0.908344\n",
      "[577]\ttrain-auc:0.908489\n",
      "[578]\ttrain-auc:0.908667\n",
      "[579]\ttrain-auc:0.908868\n",
      "[580]\ttrain-auc:0.909039\n",
      "[581]\ttrain-auc:0.909172\n",
      "[582]\ttrain-auc:0.909289\n",
      "[583]\ttrain-auc:0.90939\n",
      "[584]\ttrain-auc:0.909533\n",
      "[585]\ttrain-auc:0.909642\n",
      "[586]\ttrain-auc:0.909786\n",
      "[587]\ttrain-auc:0.909931\n",
      "[588]\ttrain-auc:0.910056\n",
      "[589]\ttrain-auc:0.910234\n",
      "[590]\ttrain-auc:0.910323\n",
      "[591]\ttrain-auc:0.910481\n",
      "[592]\ttrain-auc:0.910645\n",
      "[593]\ttrain-auc:0.910759\n",
      "[594]\ttrain-auc:0.910929\n",
      "[595]\ttrain-auc:0.911045\n",
      "[596]\ttrain-auc:0.911139\n",
      "[597]\ttrain-auc:0.911322\n",
      "[598]\ttrain-auc:0.911481\n",
      "[599]\ttrain-auc:0.91162\n",
      "[600]\ttrain-auc:0.911726\n",
      "[601]\ttrain-auc:0.911884\n",
      "[602]\ttrain-auc:0.912064\n",
      "[603]\ttrain-auc:0.912164\n",
      "[604]\ttrain-auc:0.912283\n",
      "[605]\ttrain-auc:0.912347\n",
      "[606]\ttrain-auc:0.912497\n",
      "[607]\ttrain-auc:0.91263\n",
      "[608]\ttrain-auc:0.91277\n",
      "[609]\ttrain-auc:0.912913\n",
      "[610]\ttrain-auc:0.913078\n",
      "[611]\ttrain-auc:0.913247\n",
      "[612]\ttrain-auc:0.913415\n",
      "[613]\ttrain-auc:0.91354\n",
      "[614]\ttrain-auc:0.913673\n",
      "[615]\ttrain-auc:0.913792\n",
      "[616]\ttrain-auc:0.913953\n",
      "[617]\ttrain-auc:0.914083\n",
      "[618]\ttrain-auc:0.914196\n",
      "[619]\ttrain-auc:0.914324\n",
      "[620]\ttrain-auc:0.914448\n",
      "[621]\ttrain-auc:0.914573\n",
      "[622]\ttrain-auc:0.914696\n",
      "[623]\ttrain-auc:0.914809\n",
      "[624]\ttrain-auc:0.91497\n",
      "[625]\ttrain-auc:0.915058\n",
      "[626]\ttrain-auc:0.915165\n",
      "[627]\ttrain-auc:0.915291\n",
      "[628]\ttrain-auc:0.91541\n",
      "[629]\ttrain-auc:0.915552\n",
      "[630]\ttrain-auc:0.915698\n",
      "[631]\ttrain-auc:0.915853\n",
      "[632]\ttrain-auc:0.915983\n",
      "[633]\ttrain-auc:0.916102\n",
      "[634]\ttrain-auc:0.916227\n",
      "[635]\ttrain-auc:0.916357\n",
      "[636]\ttrain-auc:0.916534\n",
      "[637]\ttrain-auc:0.91663\n",
      "[638]\ttrain-auc:0.916747\n",
      "[639]\ttrain-auc:0.916904\n",
      "[640]\ttrain-auc:0.917041\n",
      "[641]\ttrain-auc:0.917168\n",
      "[642]\ttrain-auc:0.917283\n",
      "[643]\ttrain-auc:0.917394\n",
      "[644]\ttrain-auc:0.917538\n",
      "[645]\ttrain-auc:0.91771\n",
      "[646]\ttrain-auc:0.917839\n",
      "[647]\ttrain-auc:0.91792\n",
      "[648]\ttrain-auc:0.91801\n",
      "[649]\ttrain-auc:0.918149\n",
      "[650]\ttrain-auc:0.918298\n",
      "[651]\ttrain-auc:0.918478\n",
      "[652]\ttrain-auc:0.918572\n",
      "[653]\ttrain-auc:0.918654\n",
      "[654]\ttrain-auc:0.918793\n",
      "[655]\ttrain-auc:0.918944\n",
      "[656]\ttrain-auc:0.919076\n",
      "[657]\ttrain-auc:0.919252\n",
      "[658]\ttrain-auc:0.919362\n",
      "[659]\ttrain-auc:0.9195\n",
      "[660]\ttrain-auc:0.919624\n",
      "[661]\ttrain-auc:0.919802\n",
      "[662]\ttrain-auc:0.919888\n",
      "[663]\ttrain-auc:0.920002\n"
     ]
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[664]\ttrain-auc:0.920141\n",
      "[665]\ttrain-auc:0.920357\n",
      "[666]\ttrain-auc:0.92044\n",
      "[667]\ttrain-auc:0.920609\n",
      "[668]\ttrain-auc:0.920743\n",
      "[669]\ttrain-auc:0.920872\n",
      "[670]\ttrain-auc:0.920988\n",
      "[671]\ttrain-auc:0.921061\n",
      "[672]\ttrain-auc:0.921157\n",
      "[673]\ttrain-auc:0.921276\n",
      "[674]\ttrain-auc:0.921353\n",
      "[675]\ttrain-auc:0.921497\n",
      "[676]\ttrain-auc:0.921585\n",
      "[677]\ttrain-auc:0.921743\n",
      "[678]\ttrain-auc:0.92188\n",
      "[679]\ttrain-auc:0.922034\n",
      "[680]\ttrain-auc:0.922118\n",
      "[681]\ttrain-auc:0.922225\n",
      "[682]\ttrain-auc:0.922292\n",
      "[683]\ttrain-auc:0.922455\n",
      "[684]\ttrain-auc:0.922512\n",
      "[685]\ttrain-auc:0.922631\n",
      "[686]\ttrain-auc:0.922749\n",
      "[687]\ttrain-auc:0.922864\n",
      "[688]\ttrain-auc:0.92296\n",
      "[689]\ttrain-auc:0.923033\n",
      "[690]\ttrain-auc:0.923186\n",
      "[691]\ttrain-auc:0.923323\n",
      "[692]\ttrain-auc:0.923446\n",
      "[693]\ttrain-auc:0.923634\n",
      "[694]\ttrain-auc:0.923713\n",
      "[695]\ttrain-auc:0.923886\n",
      "[696]\ttrain-auc:0.923996\n",
      "[697]\ttrain-auc:0.924084\n",
      "[698]\ttrain-auc:0.924221\n",
      "[699]\ttrain-auc:0.924307\n",
      "[700]\ttrain-auc:0.92442\n",
      "[701]\ttrain-auc:0.924557\n",
      "[702]\ttrain-auc:0.92473\n",
      "[703]\ttrain-auc:0.924825\n",
      "[704]\ttrain-auc:0.924905\n",
      "[705]\ttrain-auc:0.925084\n",
      "[706]\ttrain-auc:0.925199\n",
      "[707]\ttrain-auc:0.925317\n",
      "[708]\ttrain-auc:0.925462\n",
      "[709]\ttrain-auc:0.925553\n",
      "[710]\ttrain-auc:0.925745\n",
      "[711]\ttrain-auc:0.925848\n",
      "[712]\ttrain-auc:0.926005\n",
      "[713]\ttrain-auc:0.926158\n",
      "[714]\ttrain-auc:0.926258\n",
      "[715]\ttrain-auc:0.92638\n",
      "[716]\ttrain-auc:0.926519\n",
      "[717]\ttrain-auc:0.926654\n",
      "[718]\ttrain-auc:0.926776\n",
      "[719]\ttrain-auc:0.926894\n",
      "[720]\ttrain-auc:0.927048\n",
      "[721]\ttrain-auc:0.92718\n",
      "[722]\ttrain-auc:0.927294\n",
      "[723]\ttrain-auc:0.927382\n",
      "[724]\ttrain-auc:0.927498\n",
      "[725]\ttrain-auc:0.927615\n",
      "[726]\ttrain-auc:0.927717\n",
      "[727]\ttrain-auc:0.927846\n",
      "[728]\ttrain-auc:0.927946\n",
      "[729]\ttrain-auc:0.928059\n",
      "[730]\ttrain-auc:0.928216\n",
      "[731]\ttrain-auc:0.928341\n",
      "[732]\ttrain-auc:0.928475\n",
      "[733]\ttrain-auc:0.928556\n",
      "[734]\ttrain-auc:0.928666\n",
      "[735]\ttrain-auc:0.928789\n",
      "[736]\ttrain-auc:0.928906\n",
      "[737]\ttrain-auc:0.928994\n",
      "[738]\ttrain-auc:0.92913\n",
      "[739]\ttrain-auc:0.929217\n",
      "[740]\ttrain-auc:0.929366\n",
      "[741]\ttrain-auc:0.929437\n",
      "[742]\ttrain-auc:0.929498\n",
      "[743]\ttrain-auc:0.929583\n",
      "[744]\ttrain-auc:0.929712\n",
      "[745]\ttrain-auc:0.929857\n",
      "[746]\ttrain-auc:0.930019\n",
      "[747]\ttrain-auc:0.930129\n",
      "[748]\ttrain-auc:0.93023\n",
      "[749]\ttrain-auc:0.930333\n",
      "[750]\ttrain-auc:0.93043\n",
      "[751]\ttrain-auc:0.930555\n",
      "[752]\ttrain-auc:0.930653\n",
      "[753]\ttrain-auc:0.930747\n",
      "[754]\ttrain-auc:0.930851\n",
      "[755]\ttrain-auc:0.930958\n",
      "[756]\ttrain-auc:0.931117\n",
      "[757]\ttrain-auc:0.931282\n",
      "[758]\ttrain-auc:0.931403\n",
      "[759]\ttrain-auc:0.931472\n",
      "[760]\ttrain-auc:0.931612\n",
      "[761]\ttrain-auc:0.931731\n",
      "[762]\ttrain-auc:0.931821\n",
      "[763]\ttrain-auc:0.931931\n",
      "[764]\ttrain-auc:0.932035\n",
      "[765]\ttrain-auc:0.93211\n",
      "[766]\ttrain-auc:0.932268\n",
      "[767]\ttrain-auc:0.932419\n",
      "[768]\ttrain-auc:0.932573\n",
      "[769]\ttrain-auc:0.93271\n",
      "[770]\ttrain-auc:0.932823\n",
      "[771]\ttrain-auc:0.932971\n",
      "[772]\ttrain-auc:0.933041\n",
      "[773]\ttrain-auc:0.933149\n",
      "[774]\ttrain-auc:0.933267\n",
      "[775]\ttrain-auc:0.933424\n",
      "[776]\ttrain-auc:0.933533\n",
      "[777]\ttrain-auc:0.933613\n",
      "[778]\ttrain-auc:0.933721\n",
      "[779]\ttrain-auc:0.933822\n",
      "[780]\ttrain-auc:0.933895\n",
      "[781]\ttrain-auc:0.934017\n",
      "[782]\ttrain-auc:0.934128\n",
      "[783]\ttrain-auc:0.934219\n",
      "[784]\ttrain-auc:0.934303\n",
      "[785]\ttrain-auc:0.934414\n",
      "[786]\ttrain-auc:0.934504\n",
      "[787]\ttrain-auc:0.934592\n",
      "[788]\ttrain-auc:0.934717\n",
      "[789]\ttrain-auc:0.934844\n",
      "[790]\ttrain-auc:0.934969\n",
      "[791]\ttrain-auc:0.935102\n",
      "[792]\ttrain-auc:0.935229\n",
      "[793]\ttrain-auc:0.935337\n",
      "[794]\ttrain-auc:0.935413\n",
      "[795]\ttrain-auc:0.935474\n",
      "[796]\ttrain-auc:0.935535\n",
      "[797]\ttrain-auc:0.935701\n",
      "[798]\ttrain-auc:0.935823\n",
      "[799]\ttrain-auc:0.935941\n",
      "[800]\ttrain-auc:0.936045\n",
      "[801]\ttrain-auc:0.936159\n",
      "[802]\ttrain-auc:0.936277\n",
      "[803]\ttrain-auc:0.936431\n",
      "[804]\ttrain-auc:0.936505\n",
      "[805]\ttrain-auc:0.936587\n",
      "[806]\ttrain-auc:0.936652\n",
      "[807]\ttrain-auc:0.936745\n",
      "[808]\ttrain-auc:0.93684\n",
      "[809]\ttrain-auc:0.936939\n",
      "[810]\ttrain-auc:0.937059\n",
      "[811]\ttrain-auc:0.937186\n",
      "[812]\ttrain-auc:0.93722\n",
      "[813]\ttrain-auc:0.937342\n",
      "[814]\ttrain-auc:0.937435\n",
      "[815]\ttrain-auc:0.937523\n",
      "[816]\ttrain-auc:0.937615\n",
      "[817]\ttrain-auc:0.93771\n",
      "[818]\ttrain-auc:0.937806\n",
      "[819]\ttrain-auc:0.937902\n",
      "[820]\ttrain-auc:0.937981\n",
      "[821]\ttrain-auc:0.938047\n",
      "[822]\ttrain-auc:0.938094\n",
      "[823]\ttrain-auc:0.938149\n",
      "[824]\ttrain-auc:0.938301\n",
      "[825]\ttrain-auc:0.938401\n",
      "[826]\ttrain-auc:0.938508\n",
      "[827]\ttrain-auc:0.938615\n",
      "[828]\ttrain-auc:0.938694\n",
      "[829]\ttrain-auc:0.938808\n",
      "[830]\ttrain-auc:0.938954\n",
      "[831]\ttrain-auc:0.939024\n",
      "[832]\ttrain-auc:0.939106\n",
      "[833]\ttrain-auc:0.939252\n",
      "[834]\ttrain-auc:0.939376\n",
      "[835]\ttrain-auc:0.93947\n",
      "[836]\ttrain-auc:0.939566\n",
      "[837]\ttrain-auc:0.939673\n",
      "[838]\ttrain-auc:0.939756\n",
      "[839]\ttrain-auc:0.939843\n",
      "[840]\ttrain-auc:0.939957\n",
      "[841]\ttrain-auc:0.940077\n",
      "[842]\ttrain-auc:0.940229\n",
      "[843]\ttrain-auc:0.94031\n",
      "[844]\ttrain-auc:0.940405\n",
      "[845]\ttrain-auc:0.940495\n",
      "[846]\ttrain-auc:0.940593\n",
      "[847]\ttrain-auc:0.940685\n",
      "[848]\ttrain-auc:0.940772\n",
      "[849]\ttrain-auc:0.94089\n",
      "[850]\ttrain-auc:0.940991\n",
      "[851]\ttrain-auc:0.941112\n",
      "[852]\ttrain-auc:0.94121\n",
      "[853]\ttrain-auc:0.941324\n",
      "[854]\ttrain-auc:0.941437\n",
      "[855]\ttrain-auc:0.941585\n",
      "[856]\ttrain-auc:0.94167\n",
      "[857]\ttrain-auc:0.94176\n",
      "[858]\ttrain-auc:0.941871\n",
      "[859]\ttrain-auc:0.941964\n",
      "[860]\ttrain-auc:0.942068\n",
      "[861]\ttrain-auc:0.94217\n",
      "[862]\ttrain-auc:0.942277\n",
      "[863]\ttrain-auc:0.942378\n",
      "[864]\ttrain-auc:0.942473\n",
      "[865]\ttrain-auc:0.942539\n",
      "[866]\ttrain-auc:0.942609\n",
      "[867]\ttrain-auc:0.942729\n",
      "[868]\ttrain-auc:0.942826\n",
      "[869]\ttrain-auc:0.942909\n",
      "[870]\ttrain-auc:0.942998\n",
      "[871]\ttrain-auc:0.943057\n",
      "[872]\ttrain-auc:0.943135\n",
      "[873]\ttrain-auc:0.943273\n",
      "[874]\ttrain-auc:0.943369\n"
     ]
    }
   ],
   "source": [
    "%%time\n",
    "random_seed = list(range(1000,2000,20))\n",
    "gamma = [i/1000.0 for i in range(100,200,2)]\n",
    "max_depth = [6,7,8]\n",
    "lambd = list(range(200,400,2))\n",
    "subsample = [i/1000.0 for i in range(600,700,2)]\n",
    "colsample_bytree = [i/1000.0 for i in range(250,350,2)]\n",
    "min_child_weight = [i/1000.0 for i in range(200,300,2)]\n",
    "random.shuffle(random_seed)\n",
    "random.shuffle(gamma)\n",
    "random.shuffle(max_depth)\n",
    "random.shuffle(lambd)\n",
    "random.shuffle(subsample)\n",
    "random.shuffle(colsample_bytree)\n",
    "random.shuffle(min_child_weight)\n",
    "\n",
    "with open('params.pkl','wb') as f:\n",
    "    pickle.dump((random_seed,gamma,max_depth,lambd,subsample,colsample_bytree,min_child_weight),f)\n",
    "\n",
    "#to reproduce my result, uncomment following lines\n",
    "\"\"\"\n",
    "with open('params_for_reproducing.pkl','rb') as f:\n",
    "    random_seed,gamma,max_depth,lambd,subsample,colsample_bytree,min_child_weight = pickle.load(f)    \n",
    "\"\"\"\n",
    "\n",
    "for i in range(36):\n",
    "    pipeline(dtrain,dvalid,valid_id,i,random_seed[i],gamma[i],max_depth[i%3],lambd[i],subsample[i],colsample_bytree[i],min_child_weight[i])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
